const express = require('express');
const app = express();
const path = require('path');
const fs = require('fs');
const mysql = require('mysql');
app.listen(3000, () => { console.log('服务器已开启') });
app.get('/index', (req, res) => { res.send('a = 600') });

app.get('/demo', (req, res) => {
    //接受前端传来的参数
    console.log(req.query);
    let {callback} = req.query;
    console.log(callback)

    let data = {
        code:200,
        msg:'ok',
        data:[10,20,30]
    }

    data = JSON.stringify(data);
    res.send(`{${callback}(${data})}`)
})